<?
//读取表格多条数据的指定项

//table:表格
//sortorder：排序方式
//condition:搜索条件
//number:数据的条数

function  select_lines_items($table,$sortorder,$items,$condition,$number)
{

if($condition)	
{
$condition="where $condition";
}
else
{
$condition="";	
}


if($number)	
{
$limit="limit $number";
}
else
{
$limit="";	
}


if($sortorder)
{
    $sortorder="order by ".$sortorder;
}
else
{
$limit="";
}






$sqlstr="select $items from $table $condition $sortorder $limit";
$result = mysql_query($sqlstr);
mysql_close($con);

 
 while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
 {
    $values[] = $row;
 }
	
	
return $values ;

 }



?>